package cn.funnyxb.powerremember.uis.wordbases.localImport;

import android.os.AsyncTask;
import cn.funnyxb.powerremember.db.AllTableHolders;
import cn.funnyxb.powerremember.db.AllTables;
import cn.funnyxb.powerremember.db.tables.Tbholder_wordsbaseinfo;
import cn.funnyxb.tools.appFrame.App;
import cn.funnyxb.tools.appFrame.activityFrame.AbstractProccessor;
import cn.funnyxb.tools.appFrame.database.DBHolder;
import cn.funnyxb.tools.appFrame.database.DBService;

public class ImportTask extends AsyncTask<Void, Integer, Integer>
{
  private final int STATE_FINISHED = 2;
  private final int STATE_IMPORTING = 1;
  private final int STATE_PREPARE = 0;
  private String baseName;
  private String fileName;
  private volatile boolean isCanceled = false;
  private AbstractProccessor proccessor;
  private int state = 0;
  private volatile String tbName = null;
  private IUI_LocalImport ui;

  public ImportTask(String paramString1, String paramString2, IUI_LocalImport paramIUI_LocalImport, AbstractProccessor paramAbstractProccessor)
  {
    this.fileName = paramString1;
    this.baseName = paramString2;
    this.ui = paramIUI_LocalImport;
    this.proccessor = paramAbstractProccessor;
  }

  public void cancelImport()
  {
    this.isCanceled = true;
    cancel(true);
    switch (this.state)
    {
    case 0:
    default:
    case 1:
    case 2:
    }
    while (true)
    {
      return;
      try
      {
        App.getApp().getDBHolder().getDbService().execSql("drop table if exists " + this.tbName);
      }
      catch (Exception localException2)
      {
      }
      continue;
      try
      {
        App.getApp().getAllTableHolders().getTbholder_wordbaseinfo().removeWordBaseInfo(this.baseName, AllTables.getTbName_words(AllTables.getSelfWordBaseExtName(this.baseName)));
      }
      catch (Exception localException1)
      {
      }
    }
  }

  // ERROR //
  protected Integer doInBackground(Void[] paramArrayOfVoid)
  {
    // Byte code:
    //   0: invokestatic 58	cn/funnyxb/tools/appFrame/App:getApp	()Lcn/funnyxb/tools/appFrame/App;
    //   3: invokevirtual 62	cn/funnyxb/tools/appFrame/App:getDBHolder	()Lcn/funnyxb/tools/appFrame/database/DBHolder;
    //   6: invokevirtual 68	cn/funnyxb/tools/appFrame/database/DBHolder:getDbService	()Lcn/funnyxb/tools/appFrame/database/DBService;
    //   9: astore_2
    //   10: aload_0
    //   11: aload_0
    //   12: getfield 41	cn/funnyxb/powerremember/uis/wordbases/localImport/ImportTask:baseName	Ljava/lang/String;
    //   15: invokestatic 104	cn/funnyxb/powerremember/db/AllTables:getSelfWordBaseExtName	(Ljava/lang/String;)Ljava/lang/String;
    //   18: invokestatic 107	cn/funnyxb/powerremember/db/AllTables:getTbName_words	(Ljava/lang/String;)Ljava/lang/String;
    //   21: putfield 35	cn/funnyxb/powerremember/uis/wordbases/localImport/ImportTask:tbName	Ljava/lang/String;
    //   24: aload_0
    //   25: getfield 35	cn/funnyxb/powerremember/uis/wordbases/localImport/ImportTask:tbName	Ljava/lang/String;
    //   28: invokestatic 122	cn/funnyxb/powerremember/db/AllTables:getTbCreateSQL_words	(Ljava/lang/String;)Ljava/lang/String;
    //   31: astore_3
    //   32: aload_2
    //   33: new 70	java/lang/StringBuilder
    //   36: dup
    //   37: ldc 72
    //   39: invokespecial 75	java/lang/StringBuilder:<init>	(Ljava/lang/String;)V
    //   42: aload_0
    //   43: getfield 35	cn/funnyxb/powerremember/uis/wordbases/localImport/ImportTask:tbName	Ljava/lang/String;
    //   46: invokevirtual 79	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   49: invokevirtual 83	java/lang/StringBuilder:toString	()Ljava/lang/String;
    //   52: invokevirtual 88	cn/funnyxb/tools/appFrame/database/DBService:execSql	(Ljava/lang/String;)V
    //   55: aload_2
    //   56: aload_3
    //   57: invokevirtual 88	cn/funnyxb/tools/appFrame/database/DBService:execSql	(Ljava/lang/String;)V
    //   60: aload_0
    //   61: iconst_1
    //   62: putfield 33	cn/funnyxb/powerremember/uis/wordbases/localImport/ImportTask:state	I
    //   65: aconst_null
    //   66: astore 4
    //   68: iconst_0
    //   69: istore 5
    //   71: new 124	java/io/InputStreamReader
    //   74: dup
    //   75: new 126	java/io/FileInputStream
    //   78: dup
    //   79: aload_0
    //   80: getfield 39	cn/funnyxb/powerremember/uis/wordbases/localImport/ImportTask:fileName	Ljava/lang/String;
    //   83: invokespecial 127	java/io/FileInputStream:<init>	(Ljava/lang/String;)V
    //   86: ldc 129
    //   88: invokespecial 132	java/io/InputStreamReader:<init>	(Ljava/io/InputStream;Ljava/lang/String;)V
    //   91: astore 6
    //   93: new 134	java/io/BufferedReader
    //   96: dup
    //   97: aload 6
    //   99: invokespecial 137	java/io/BufferedReader:<init>	(Ljava/io/Reader;)V
    //   102: astore 7
    //   104: aload 7
    //   106: invokevirtual 140	java/io/BufferedReader:readLine	()Ljava/lang/String;
    //   109: astore 15
    //   111: aload 15
    //   113: ifnonnull +74 -> 187
    //   116: aload 7
    //   118: ifnull +8 -> 126
    //   121: aload 7
    //   123: invokevirtual 143	java/io/BufferedReader:close	()V
    //   126: aload_0
    //   127: iconst_2
    //   128: putfield 33	cn/funnyxb/powerremember/uis/wordbases/localImport/ImportTask:state	I
    //   131: aload_0
    //   132: getfield 37	cn/funnyxb/powerremember/uis/wordbases/localImport/ImportTask:isCanceled	Z
    //   135: ifne +42 -> 177
    //   138: invokestatic 58	cn/funnyxb/tools/appFrame/App:getApp	()Lcn/funnyxb/tools/appFrame/App;
    //   141: invokevirtual 92	cn/funnyxb/tools/appFrame/App:getAllTableHolders	()Lcn/funnyxb/powerremember/db/AllTableHolders;
    //   144: invokevirtual 98	cn/funnyxb/powerremember/db/AllTableHolders:getTbholder_wordbaseinfo	()Lcn/funnyxb/powerremember/db/tables/Tbholder_wordsbaseinfo;
    //   147: astore 22
    //   149: aload_0
    //   150: getfield 41	cn/funnyxb/powerremember/uis/wordbases/localImport/ImportTask:baseName	Ljava/lang/String;
    //   153: astore 23
    //   155: aload_0
    //   156: getfield 41	cn/funnyxb/powerremember/uis/wordbases/localImport/ImportTask:baseName	Ljava/lang/String;
    //   159: invokestatic 104	cn/funnyxb/powerremember/db/AllTables:getSelfWordBaseExtName	(Ljava/lang/String;)Ljava/lang/String;
    //   162: astore 24
    //   164: aload 22
    //   166: aload 23
    //   168: ldc 145
    //   170: iload 5
    //   172: aload 24
    //   174: invokevirtual 149	cn/funnyxb/powerremember/db/tables/Tbholder_wordsbaseinfo:insertARecord	(Ljava/lang/String;Ljava/lang/String;ILjava/lang/String;)V
    //   177: iload 5
    //   179: invokestatic 155	java/lang/Integer:valueOf	(I)Ljava/lang/Integer;
    //   182: astore 11
    //   184: aload 11
    //   186: areturn
    //   187: aload 7
    //   189: invokevirtual 140	java/io/BufferedReader:readLine	()Ljava/lang/String;
    //   192: astore 16
    //   194: aload 16
    //   196: ifnull -80 -> 116
    //   199: aload 16
    //   201: ldc 157
    //   203: invokevirtual 163	java/lang/String:startsWith	(Ljava/lang/String;)Z
    //   206: ifeq +261 -> 467
    //   209: aload 16
    //   211: astore 18
    //   213: ldc 145
    //   215: astore 17
    //   217: aload 7
    //   219: invokevirtual 140	java/io/BufferedReader:readLine	()Ljava/lang/String;
    //   222: astore 19
    //   224: aload 19
    //   226: ifnonnull +83 -> 309
    //   229: aload_0
    //   230: getfield 37	cn/funnyxb/powerremember/uis/wordbases/localImport/ImportTask:isCanceled	Z
    //   233: ifne +44 -> 277
    //   236: aload_0
    //   237: getfield 35	cn/funnyxb/powerremember/uis/wordbases/localImport/ImportTask:tbName	Ljava/lang/String;
    //   240: invokestatic 166	cn/funnyxb/powerremember/db/AllTables:getTbInsertSQL_words	(Ljava/lang/String;)Ljava/lang/String;
    //   243: astore 26
    //   245: iconst_3
    //   246: anewarray 168	java/lang/Object
    //   249: astore 27
    //   251: aload 27
    //   253: iconst_0
    //   254: aload 15
    //   256: aastore
    //   257: aload 27
    //   259: iconst_1
    //   260: aload 18
    //   262: aastore
    //   263: aload 27
    //   265: iconst_2
    //   266: aload 17
    //   268: aastore
    //   269: aload_2
    //   270: aload 26
    //   272: aload 27
    //   274: invokevirtual 171	cn/funnyxb/tools/appFrame/database/DBService:execSql	(Ljava/lang/String;[Ljava/lang/Object;)V
    //   277: iconst_1
    //   278: anewarray 151	java/lang/Integer
    //   281: astore 21
    //   283: iinc 5 1
    //   286: aload 21
    //   288: iconst_0
    //   289: iload 5
    //   291: invokestatic 155	java/lang/Integer:valueOf	(I)Ljava/lang/Integer;
    //   294: aastore
    //   295: aload_0
    //   296: aload 21
    //   298: invokevirtual 175	cn/funnyxb/powerremember/uis/wordbases/localImport/ImportTask:publishProgress	([Ljava/lang/Object;)V
    //   301: aload 19
    //   303: ifnonnull -199 -> 104
    //   306: goto -190 -> 116
    //   309: aload 19
    //   311: invokevirtual 178	java/lang/String:trim	()Ljava/lang/String;
    //   314: ldc 145
    //   316: invokevirtual 182	java/lang/String:equals	(Ljava/lang/Object;)Z
    //   319: ifne -90 -> 229
    //   322: new 70	java/lang/StringBuilder
    //   325: dup
    //   326: aload 17
    //   328: invokestatic 185	java/lang/String:valueOf	(Ljava/lang/Object;)Ljava/lang/String;
    //   331: invokespecial 75	java/lang/StringBuilder:<init>	(Ljava/lang/String;)V
    //   334: aload 19
    //   336: invokevirtual 79	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   339: invokevirtual 83	java/lang/StringBuilder:toString	()Ljava/lang/String;
    //   342: astore 20
    //   344: aload 20
    //   346: astore 17
    //   348: goto -131 -> 217
    //   351: astore 29
    //   353: aload_0
    //   354: getfield 43	cn/funnyxb/powerremember/uis/wordbases/localImport/ImportTask:ui	Lcn/funnyxb/powerremember/uis/wordbases/localImport/IUI_LocalImport;
    //   357: invokeinterface 190 1 0
    //   362: aload 4
    //   364: ifnull +8 -> 372
    //   367: aload 4
    //   369: invokevirtual 143	java/io/BufferedReader:close	()V
    //   372: aconst_null
    //   373: astore 11
    //   375: goto -191 -> 184
    //   378: astore 28
    //   380: aload_0
    //   381: getfield 43	cn/funnyxb/powerremember/uis/wordbases/localImport/ImportTask:ui	Lcn/funnyxb/powerremember/uis/wordbases/localImport/IUI_LocalImport;
    //   384: invokeinterface 193 1 0
    //   389: aload 4
    //   391: ifnull +8 -> 399
    //   394: aload 4
    //   396: invokevirtual 143	java/io/BufferedReader:close	()V
    //   399: aconst_null
    //   400: astore 11
    //   402: goto -218 -> 184
    //   405: astore 9
    //   407: aload 4
    //   409: ifnull +8 -> 417
    //   412: aload 4
    //   414: invokevirtual 143	java/io/BufferedReader:close	()V
    //   417: aload 9
    //   419: athrow
    //   420: astore 12
    //   422: goto -50 -> 372
    //   425: astore 14
    //   427: goto -28 -> 399
    //   430: astore 10
    //   432: goto -15 -> 417
    //   435: astore 25
    //   437: goto -311 -> 126
    //   440: astore 9
    //   442: aload 7
    //   444: astore 4
    //   446: goto -39 -> 407
    //   449: astore 13
    //   451: aload 7
    //   453: astore 4
    //   455: goto -75 -> 380
    //   458: astore 8
    //   460: aload 7
    //   462: astore 4
    //   464: goto -111 -> 353
    //   467: aload 16
    //   469: astore 17
    //   471: ldc 145
    //   473: astore 18
    //   475: goto -258 -> 217
    //
    // Exception table:
    //   from	to	target	type
    //   71	104	351	java/io/FileNotFoundException
    //   71	104	378	java/io/IOException
    //   71	104	405	finally
    //   353	362	405	finally
    //   380	389	405	finally
    //   367	372	420	java/io/IOException
    //   394	399	425	java/io/IOException
    //   412	417	430	java/io/IOException
    //   121	126	435	java/io/IOException
    //   104	111	440	finally
    //   187	344	440	finally
    //   104	111	449	java/io/IOException
    //   187	344	449	java/io/IOException
    //   104	111	458	java/io/FileNotFoundException
    //   187	344	458	java/io/FileNotFoundException
  }

  protected void onPostExecute(Integer paramInteger)
  {
    if (!(this.isCanceled))
      this.ui.notifyImportCompleted(paramInteger);
    this.proccessor.unRegAsyncTask(this);
  }

  protected void onPreExecute()
  {
    this.state = 0;
    this.proccessor.regAsyncTask(this);
    if (this.isCanceled)
      return;
    this.ui.notifyWaitingImport();
  }

  protected void onProgressUpdate(Integer[] paramArrayOfInteger)
  {
    if (this.isCanceled)
      return;
    this.ui.notifyHasImport(paramArrayOfInteger[0].intValue());
  }
}

/* Location:           E:\Desktop\复件 classes_dex2jar.jar
 * Qualified Name:     cn.funnyxb.powerremember.uis.wordbases.localImport.ImportTask
 * JD-Core Version:    0.5.3
 */